home *** CD-ROM | disk | FTP | other *** search
/ Pascal Super Library / Pascal Super Library (CW International)(1997).bin / LIBRARY / PASDEMO2 / GRAPHTST.PAS < prev    next >
Pascal/Delphi Source File  |  1988-01-15  |  933b  |  29 lines

  1. program GraphTest;
  2. uses
  3.    Graph;
  4. var
  5.    GraphDriver,
  6.    GraphMode,
  7.    ErrorCode: integer;
  8.    ModeCnt: integer;
  9. begin
  10.    GraphDriver := Detect;   { Set flag: do detection }
  11.    InitGraph( GraphDriver, GraphMode, 'C:\DRIVERS' );
  12.    ErrorCode := GraphResult;
  13.    if ErrorCode <> GrOK then begin  { Error? }
  14.       writeln( 'Graphics error: ', GraphErrorMsg( ErrorCode ) );
  15.       writeln( 'Program aborted...' );
  16.       Halt( 1 );
  17.    end;
  18.    Rectangle( 0, 0, GetMaxX, GetMaxY );   { Draw full screen box }
  19.    SetTextJustify( CenterText, CenterText );   { Center text }
  20.    for ModeCnt := 0 to 2 do begin
  21.       SetTextStyle( DefaultFont, HorizDir, ModeCnt );
  22.       OutTextXY( GetMaxX div 2, GetMaxY div 2 + ModeCnt*10,
  23.                  'Borland Graphics Interface (BGI)' );
  24.    end;
  25.    ErrorCode := GraphResult;
  26.    readln;
  27.    CloseGraph;
  28.    writeln( 'Error Code: ', ErrorCode );
  29. end.   { end of program GraphTest }